#ifndef REGIST_H
#define REGIST_H

#include <QDialog>
#include <QWidget>
#include <QDialog>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QMessageBox>
#include <QTcpSocket>

#include "Interfaces/protocol.h"

class Regist : public QDialog
{
    Q_OBJECT
public:
    explicit Regist(QWidget *parent = nullptr);
    ~Regist();

    static Regist &getInstance();

public slots:
    void recvMsg();

private slots:
    void on_registButton_clicked();

private:
    QLabel *usernameLabel;
    QLineEdit *usernameLineEdit;
    QLabel *passwordLabel;
    QLineEdit *passwordLineEdit;
    QLabel *confirmPasswordLabel;
    QLineEdit *confirmPasswordLineEdit;
//    QLabel *emailLabel;
//    QLineEdit *emailLineEdit;
    QPushButton *registButton;
    QLabel *statusLabel;
    bool isUsernameAvailable(const QString &username);
    bool isValidEmail(const QString &email);

    QTcpSocket tcpsocket;

signals:

};

#endif // REGIST_H
